package com.stars.easyms.logger.support.logback.util;

import com.stars.easyms.logger.support.logback.handler.EasyMsAsynAppenderAddExecutor;

import java.util.List;

/**
 * <p>className: EasyMsAsynAppenderAddExecutorHolder</p>
 * <p>description: EasyMs异步Appender添加执行者的列表holder类</p>
 *
 * @author guoguifang
 * @date 2019-11-06 19:18
 * @since 1.3.3
 */
public final class EasyMsAsynAppenderAddExecutorHolder {

    private static final ThreadLocal<List<EasyMsAsynAppenderAddExecutor>> ADD_EXECUTOR_THREAD_LOCAL = new ThreadLocal<>();

    public static void setAsynAppenderAddExecutorList(List<EasyMsAsynAppenderAddExecutor> asynAppenderAddExecutorList) {
        ADD_EXECUTOR_THREAD_LOCAL.set(asynAppenderAddExecutorList);
    }

    public static List<EasyMsAsynAppenderAddExecutor> getAsynAppenderAddExecutorList() {
        return ADD_EXECUTOR_THREAD_LOCAL.get();
    }

    public static void clear() {
        ADD_EXECUTOR_THREAD_LOCAL.remove();
    }

    private EasyMsAsynAppenderAddExecutorHolder() {
    }
}